<template>
  <div>
    <!-- 轮播+登录 -->
    <div style="positive:relative;height:280px">
      <!-- swiper轮播图 -->
      <div class="recommendPage" style="positive:absolute;z-index:9">
        <swiper :options="swiperOption" ref="mySwiper" style="borderRadius:6px">
            <!-- <swiper-slide class="slide" v-for="index in 4" :key="index">
                <img :src="`../assets/image/bg0${index+1}.png`" />
            </swiper-slide> -->
            <swiper-slide>
                <img src="@/assets/image/bg05.png" alt="">
            </swiper-slide>
            <swiper-slide>
                <img src="@/assets/image/bg05.png" alt="">
            </swiper-slide>
            <swiper-slide>
                <img src="@/assets/image/bg05.png" alt="">
            </swiper-slide>
            <swiper-slide>
                <img src="@/assets/image/bg05.png" alt="">
            </swiper-slide>
            <div class="swiper-pagination" style="positive:absolute;left:0px;top:250px;z-index:10" slot="pagination"></div>
            <div class="swiper-button-prev" slot="button-prev"></div>
            <div class="swiper-button-next" slot="button-next"></div>
        </swiper>
        </div>
    </div>
  </div>
</template>
<script>
// 引入插件
import { swiper, swiperSlide } from "vue-awesome-swiper";
import "swiper/dist/css/swiper.css";
export default {
  components: {
    swiper,
    swiperSlide,
  },
  data() {
    return {
      swiperOption: {
        loop: true,
        autoplay: {
          delay: 3000,
          stopOnLastSlide: false,
          disableOnInteraction: false
        },
        // 显示分页
        pagination: {
          el: ".swiper-pagination",
          clickable: true //允许分页点击跳转
        },
        // 设置点击箭头
        navigation: {
          nextEl: ".swiper-button-next",
          prevEl: ".swiper-button-prev"
        }
      }
    };
  },
  computed: {
    swiper() {
      return this.$refs.mySwiper.swiper;
    }
  },
  mounted() {
    console.log("this is current swiper instance object", this.swiper);
  }
};
</script>
<style lang="less" scoped>
.recommendPage .swiper-container{
  position: relative;
  width: 100%;
  height: 280px;
}  
.recommendPage .swiper-container .swiper-slide{
  width: 100%;
  line-height: 280px;
  // background: yellowgreen;
  color: #000;
  font-size: 16px;
  textAlign: center;
}
img {
    display: block;
    width: 100%;
}
.flexher {
    /*flex 布局*/
    display: flex;
    /*实现垂直居中*/
    align-items: center;
    /*实现水平居中*/
    justify-content: center;
    padding: 17px 0;
}
a {
  color: #ffffff;
}
.lrpadding {
  padding: 0 20px;
}
</style>
